package cece.service.impl;

import cece.entity.Address;
import cece.mapper.AddressRepository;
import cece.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther Programmer
 * @Date 2020-05-28 18:03
 */
@Service
public class AddressServiceImpl implements AddressService {
	@Autowired
	private AddressRepository addressRepository;

	@Override
	public List<Address> findAll() {
		return addressRepository.findAll();
	}

	@Override
	public String update(Address address) {
		Address result = addressRepository.saveAndFlush(address);
		if (result != null) {
			return "success";
		}
		return "fail";
	}
}
